<section id="aces" ng-app="doc.ui-ace" ng-cloak >

<!-- =Minimal code
--------------------------------------------------------------------------- -->
<div id="demo-mini">
  <div class="page-header">
    <h1>Minimal code</h1>
  </div>
  <div class="row">
    <div class="col-md-6">
      <div >
        <div ui-ace>Ace here</div>
      </div>
    </div>

    <div class="col-md-6" ng-controller="PlunkerCtrl"
         ng-init="
  vendor_js=['https://rawgithub.com/ajaxorg/ace-builds/v1.1.1/src-min-noconflict/ace.js'];
    "
        >
      <div class="pull-right">
        <button class="btn btn-info" ng-click="edit('1.3.8', 'UI.Ace', 'ui-ace')"><i
            class="icon-edit icon-white"></i> Edit in plunker
        </button>
      </div>

      <tabset>
        <tab heading="Markup">
          <div plunker-content="markup">
  <pre class="prettyprint">&lt;section&gt;
  &lt;div ui-ace &gt;Ace here&lt;/div&gt;
&lt;/section&gt;</pre>
          </div>
        </tab>
        <tab heading="CSS">
          <div plunker-content="css">
  <pre class="prettyprint">.ace_editor  {
  height : 200px;
}
  </pre>
          </div>
        </tab>
      </tabset>
    </div>
  </div>
</div>

<!-- =General options demo
--------------------------------------------------------------------------- -->
<div id="demo-general">
  <div class="page-header">
    <h1>General options</h1>
  </div>
  <div class="row">
    <div class="col-md-6">
      <div>
        <div ui-ace="{
            useWrapMode : true,
            showGutter: false,
            theme:'twilight',
            mode: 'markdown'
          }"># Theme and mode

*Lorem ipsum* dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
      </div>
    </div>

    <div class="col-md-6" ng-controller="PlunkerCtrl"
         ng-init="
vendor_js=['https://rawgithub.com/ajaxorg/ace-builds/v1.1.1/src-min-noconflict/ace.js'];
      "
        >
      <div class="pull-right">
        <button class="btn btn-info" ng-click="edit('1.3.8', 'UI.Ace', 'ui-ace')"><i
            class="icon-edit icon-white"></i> Edit in plunker
        </button>
      </div>

      <tabset>
        <tab heading="Markup">
          <div plunker-content="markup">
<pre class="prettyprint">&lt;section&gt;
    &lt;div ui-ace=&quot;{
      useWrapMode : true,
      showGutter: false,
      theme:'twilight',
      mode: 'markdown'
    }&quot; &gt;# Theme and mode

*Lorem ipsum* dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&lt;/div&gt;

&lt;/section&gt;</pre>
          </div>
        </tab>
        <tab heading="CSS">
          <div plunker-content="css">
<pre class="prettyprint">.ace_editor  {
  height : 200px;
}
</pre>
          <div style="margin-top: 260px;"></div>
          </div>
        </tab>
      </tabset>
    </div>
  </div>
</div>

<!-- =Mode-Changing demo
--------------------------------------------------------------------------- -->
<div id="demo-mode-changing">
    <div class="page-header">
      <h1>Mode-Changing demo</h1>
    </div>

    <div class="row" ng-controller="AceCtrl">
      <div class="col-md-12">
        <div ui-ace="aceOption" ng-model="aceModel">Ace here</div>
      </div>
      <div class="col-md-6">
        Mode : <select class="form-control" ng-model="mode" ng-options="m for m in modes" ng-change="modeChanged()"></select>
      </div>
    </div>

<hr>

  <div ng-controller="PlunkerCtrl"
       ng-init="
vendor_js=['https://rawgithub.com/ajaxorg/ace-builds/v1.1.1/src-min-noconflict/ace.js'];
        "
      >
    <div class="pull-right">
      <button class="btn btn-info" ng-click="edit('1.3.8', 'UI.Ace', 'ui-ace')"><i
          class="icon-edit icon-white"></i> Edit in plunker
      </button>
    </div>

    <tabset>
      <tab heading="Markup">
        <div plunker-content="markup">
<pre class="prettyprint">&lt;section ng-controller=&quot;AceCtrl&quot;&gt;

  &lt;div ui-ace=&quot;aceOption&quot; ng-model=&quot;aceModel&quot;&gt;&lt;/div&gt;

  &lt;select ng-model=&quot;mode&quot; ng-options=&quot;m for m in modes&quot; ng-change=&quot;modeChanged()&quot;&gt;&lt;/select&gt;

&lt;/section&gt;</pre>
          <div style="margin-top: 390px;"></div>
        </div>
      </tab>
      <tab heading="JavaScript">
        <div plunker-content="javascript">
<pre class="prettyprint">function AceCtrl($scope) {
// The modes
  $scope.modes = [&#39;Scheme&#39;, &#39;XML&#39;, &#39;Javascript&#39;];
  $scope.mode = $scope.modes[0];


  // The ui-ace option
  $scope.aceOption = {
    mode: $scope.mode.toLowerCase(),
    onLoad: function (_ace) {

      // HACK to have the ace instance in the scope...
      $scope.modeChanged = function () {
        _ace.getSession().setMode(&quot;ace/mode/&quot; + $scope.mode.toLowerCase());
      };

    }
  };

  // Initial code content...
  $scope.aceModel = &#39;;; Scheme code in here.\n&#39; +
    &#39;(define (double x)\n\t(* x x))\n\n\n&#39; +
    &#39;&lt;!-- XML code in here. --&gt;\n&#39; +
    &#39;&lt;root&gt;\n\t&lt;foo&gt;\n\t&lt;/foo&gt;\n\t&lt;bar/&gt;\n&lt;/root&gt;\n\n\n&#39; +
    &#39;// Javascript code in here.\n&#39; +
    &#39;function foo(msg) {\n\tvar r = Math.random();\n\treturn &quot;&quot; + r + &quot; : &quot; + msg;\n}&#39;;

}</pre>
        </div>
      </tab>
      <tab heading="CSS">
        <div plunker-content="css">
<pre class="prettyprint">.ace_editor  {
  height : 300px;
}
</pre>
          <div style="margin-top: 470px;"></div>
        </div>
      </tab>
    </tabset>
  </div>
</div>


</section>
